Repository navigation
Add end-to-end integration test framework with first feature tests. - #359
Open
mattday-etas wants to merge 1 commit into
Open
mattday-etas wants to merge 1 commit into
mattday-etas wants to merge 1 commit into
Conversation
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 15:18 — with
GitHub Actions
Error
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 15:18 — with
GitHub Actions
Error
Contributor
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:07 — with
GitHub Actions
Error
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:07 — with
GitHub Actions
Error
mattday-etas
force-pushed
the
e2e-time-integration-tests-1
branch
from
November 25, 2026 16:19
09095eb to
691ec2c
Compare
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:20 — with
GitHub Actions
Error
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:20 — with
GitHub Actions
Error
Contributor
|
Quality pack traceability report for this pull request: Status: PASS (workflow run) |
Contributor
|
Documentation preview for this pull request is available at: |
mattday-etas
force-pushed
the
e2e-time-integration-tests-1
branch
from
November 25, 2026 16:37
691ec2c to
ad0fadd
Compare
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:37 — with
GitHub Actions
Error
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:37 — with
GitHub Actions
Error
mattday-etas
force-pushed
the
e2e-time-integration-tests-1
branch
from
November 25, 2026 16:44
ad0fadd to
000b1a6
Compare
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:45 — with
GitHub Actions
Error
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:45 — with
GitHub Actions
Error
mattday-etas
force-pushed
the
e2e-time-integration-tests-1
branch
from
November 25, 2026 16:54
000b1a6 to
3f10a6a
Compare
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:55 — with
GitHub Actions
Error
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 16:55 — with
GitHub Actions
Error
mattday-etas
force-pushed
the
e2e-time-integration-tests-1
branch
from
November 25, 2026 17:05
3f10a6a to
3479208
Compare
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 17:05 — with
GitHub Actions
Error
mattday-etas
had a problem deploying
to
workflow-approval
November 25, 2026 17:05 — with
GitHub Actions
Error
Introduces the QEMU-based end-to-end test framework (Linux x86_64 and QNX aarch64 targets), the software gPTP grandmaster, the vehicle time probe, the known-issue xfail markers, the documentation and the GitHub Actions workflow, together with a first set of feature tests: clocks, startup and synchronization.
mattday-etas
force-pushed
the
e2e-time-integration-tests-1
branch
from
November 25, 2026 17:41
3479208 to
0fb4e8f
Compare
mattday-etas
requested a deployment
to
workflow-approval
November 25, 2026 17:41 — with
GitHub Actions
Waiting
mattday-etas
requested a deployment
to
workflow-approval
November 25, 2026 17:41 — with
GitHub Actions
Waiting
mattday-etas
marked this pull request as ready for review
November 26, 2026 17:20
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of 2. Followed by #360.
What this adds
A framework that runs the real
time_slaveandtime_daemonbinaries together in a QEMU VM. A software gPTP grandmaster on the host feeds them time, and the tests read vehicle time and notifications back through the publicscore::timeclient API. The existing unit tests cover single classes, and this checks the feature requirements on the whole stack.score/tests/common/): the Bazel macroqemu_itf_tests(), the pytest fixtures and helpers, a Python gPTP grandmaster with fault injection, thevehicle_time_probeC++ client, target images for Linux x86_64 (ITF Ubuntu image) and QNX aarch64, andknown_issues.py(see below).score/tests/feature/):test_clocks,test_startup,test_synchronization. They are a deliberately small set of happy-path tests that exercise the whole framework..github/workflows/e2e-tests.ymlruns the Linux x86_64 feature target.docs/module/manuals/integration_tests.rst. It covers the architecture, fixtures, known issues, running and troubleshooting..bazelrcandMODULE.bazeladditions, andtools/qemu/setup_qemu_host.sh.The remaining feature tests and the component tests come in #360. Their BUILD files glob
test_*.py, so that PR needs no build changes.Design notes
CLOCK_REALTIMEplus a fixed 1 h offset. This means a result that merely echoes the guest's own clock can't pass.ProbeStreamsamples it every 20 ms, so short-lived states (such as a time-jump flag clearing after two Syncs) are visible.--config=qemuruns underrun_under_qemu. That creates a private user and network namespace with its owntap0, so no sudo or host tap device is needed.manual. They need KVM andCAP_NET_RAW, so they stay out of//score/...and are named explicitly in CI.xfailmarker fromknown_issues.py, which is the only place markers are defined.strict=Trueis for deterministic defects. The test fails when the defect is fixed, which reminds whoever fixes it to remove the marker.strict=Falseis for platform-dependent failures, mainly software timestamp jitter on the virtio NIC, which has no hardware timestamps.CLOCK_MONOTONICandCLOCK_MONOTONIC_RAWdiffer by more than 0.5 %. A slewed host clock (seen on WSL2 withsystemd-timesyncd) would otherwise cause confusing drift failures.--test_arg=--skip-host-clock-checkbypasses it.How to run the tests
Prerequisites: Run
tools/qemu/setup_qemu_host.shfrom the devcontainer to install QEMU and add your user to thekvmgroup. Unless you log out and back in, you must then prefix commands withsg kvm -c '...'. You may also needsudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0for the user namespace (CI does the same). If running under WSL, the timesync daemon can unnecessarily interfere with the clock in some circumstances, and cause tests to fail. It can be disabled withsudo systemctl disable --now systemd-timesyncd.Example command:
Useful extras:
--test_arg=-k --test_arg=startupruns a subset, and--nocache_test_resultsforces a rerun. The log is atbazel-testlogs/score/tests/feature/<target>/test.log.The QNX target (
--config=arm64-qnx --config=qemu, target suffix_qnx_aarch64) needs the QNX SDP toolchain and licence. It is emulated, so it's slow, and CI doesn't run it.Timing: The tests take about 3 minutes on Linux x86_64 (KVM), including the VM boot, assuming a cached build. The QNX aarch64 target is emulated without KVM, so it is slower, at around 5 minutes.
Review tips
Start with
docs/module/manuals/integration_tests.rst, thencommon/fixtures.pyandcommon/qemu_tests.bzl.gptp_grandmaster.pyandhelpers.pyare the bulk of the lines.